﻿using System.Collections.Generic;
using System.Linq;
using DevFramework.Core.Aspects.CacheAspects;
using DevFramework.Business.Abstract;
using DevFramework.DataLayer.Abstract;
using DevFramework.Entities.Concrete;

namespace DevFramework.Business.Concrete.Managers
{
    public class LanguageWordManager : ILanguageWordService
    {
        private readonly ILanguageWordDal _languageWordDal;

        public LanguageWordManager(ILanguageWordDal languageWordDal)
        {
            _languageWordDal = languageWordDal;
        }

   
        public List<LanguageWord> GetAll()
        {
            return _languageWordDal.GetList();
        }

      
        public List<LanguageWord> GetByLanguage(int dilId)
        {
            return _languageWordDal.GetList(filter: t => t.LanguageId == dilId);
        }
     
        public LanguageWord GetValue(int dilId, string kod)
        {
            return GetByLanguage(dilId).FirstOrDefault(t => t.Code == kod);
        }
    }
}
